<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
	<table width="100%">
		<tbody>
			<tr>
				<td height="40" class="sectionheading bottom-border">
					Promotional Codes
				</td>
			</tr>
			<tr align="left">
				<td>
					<s:actionerror cssClass="note-red" />
					<s:actionmessage cssClass="note-red" />
					<s:fielderror cssClass="note-red" />
				</td>
			</tr>
			<tr>
				<td>
				<s:form theme="simple" method="post" action="addPromotionalCodes.htm" id="form">
					<table class="verdana12blacknormal" width="100%">
						<tbody>
							<s:hidden name="promotionalCode.id" value="%{promotionalCode.id}" />
							<tr>
								<td align="center" class="verdana12Greybold">
									Money:
									<s:textfield name="promotionalCode.money" theme="simple"/>
								</td>
							</tr>
							<tr>
								<td align="center">
									<table>
									<tr><td>
									<s:submit type="image" src="../Admin-Images/add-new-promotional-btn.gif" theme="simple" value="Add new Promotional Code" />
									</td><td>
									<img style="cursor: pointer;"
										onclick="document.getElementById('form').reset();"
										src="../Admin-Images/reset-button.gif" alt="Reset">
									</td></tr>
									</table>
								</td>
							</tr>
						</tbody>
					</table>
					</s:form>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="0" cellpadding="0" cellspacing="0"
						class="Textfiled-border">
						<tr>
							<td height="30" width="5%" align="center" bgcolor="#E9E9E9"
								class="right-border verdana12darkgreybold">
								#
							</td>
							<td align="center" width="15%" bgcolor="#E9E9E9"
								class="right-border verdana12darkgreybold">
								Promotional Code
							</td>
							<td align="center" width="25%" bgcolor="#E9E9E9"
								class="right-border verdana12darkgreybold">
								User
							</td>
							<td align="center" width="20%" bgcolor="#E9E9E9"
								class="right-border verdana12darkgreybold">
								Money
							</td>
						</tr>

						<s:iterator value="promotionalCodeList" var="testList" status="rowstatus">
								<s:set name="classCSS" value="%{'Textfiled-no-border-odd'}"
									var="classCSS"></s:set>
								<s:set name="bgColor" value="%{'#FFFFFF'}" var="bgColor"></s:set>

								<s:if test="#rowstatus.even">
									<s:set var="classCSS" value="%{'Textfiled-no-border-even'}"></s:set>
									<s:set var="bgColor" value="%{'#F8F8F8'}"></s:set>
								</s:if>
							<s:hidden
									name="promotionalCodeMap[%{id}].id"
									value="%{id}" />
							<tr>
								<td height="23" align="center"
									bgcolor="<s:property value="%{bgColor}" />"
									class="right-border verdana12darkgreybold">
									<s:property value="#rowstatus.index + 1" />
								</td>
								<td align="center" bgcolor="<s:property value="%{bgColor}" />"
									 class="right-border verdana12Greybold">
									<s:property value="%{promotionalCode}" />
								</td>
								<td align="center" bgcolor="<s:property value="%{bgColor}" />"
									class="right-border verdana12Greybold">
									<s:property value="%{user.userId}" />
								</td>
								<td bgcolor="<s:property value="%{bgColor}" />"
									align="center" 	class="right-border verdana12Greybold">
									<s:property value="%{money}"/>
								</td>
							</tr>
						</s:iterator>
					</table>
				</td>
			</tr>
		</tbody>
	</table>